﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AdaptiveDeNet.RAND
{
    public class Rand : Random
    {
        private MersenneTwister rand;

        public Rand()
        {
            rand = new MersenneTwister((ulong)DateTime.Now.Ticks);
        }

        public Rand(long seed)
        {
            rand = new MersenneTwister((ulong)seed);
        }

        public Rand(Rand rand)
        {
            this.rand = rand.rand;
        }

        override
        public double NextDouble()
        {
            return rand.genrand_real1();
        }

        override    
        public int Next(int n)
        {
            return rand.genrand_N(n);
        }

    }
}
